#!/usr/bin/env python
# -*- coding: utf-8 -*-

from flask import request
from flask_restful import Resource
from common.odooClient import Client

class ResUsersAPI(Resource):
    def get(self):
        odoo = Client.getInstance()
        user_model = odoo.model('res.users')
        if(request.args.get('user_id') and request.args.get('user_id') != 'null'):
            user_id = request.args.get('user_id')
            user_obj = user_model.read(user_id, ['id', 'login'])
        else:
            user_obj = {}
        return user_obj